﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OnlineMovieTicket.Data.IRepository;

namespace OnlineMovieTicket.Data.Repository
{
    public class CinemaHallRepository: ICinemaHallRepository
    {
        ONLINEMOVIETICKETEntities dataContent;

        public CinemaHallRepository()
        {
            dataContent = new ONLINEMOVIETICKETEntities();
        }

        public IList<Model.CinemaHall> GetCinemaHallsByCinema(int CinemaID)
        {
            var data = (from d in dataContent.CinemaHalls
                       where d.CinemaID == CinemaID
                       select new Model.CinemaHall
                       {
                           CinemaHallID = d.CinemaHallID,
                           CinemaID = d.CinemaID,
                           CinemaHallName = d.CinemaHallName
                       }).ToList();
            return data;
        }
    }
}
